﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace BackgroundTest.BasicAbstracts
{
    /// <summary>
    /// The basic data of the game, containing the frame rate, window size, etc.
    /// </summary>
    class BasicData
    {
        // The width of the window
        static int windowWidth;
        static public int WindowWidth
        {
            get { return windowWidth; }
        }

        // The height of the window
        static int windowHeight;
        static public int WindowHeight
        {
            get { return windowHeight; }
        }

        // The width of the land form.
        static int landformWidth;
        static public int LandformWidth
        {
            get { return landformWidth; }
        }

        // The height of the land form
        static int landformHeight;
        static public int LandformHeight
        {
            get { return landformHeight; }
        }

        // The height per stair
        static int stairHeight;
        static public int StairHeight
        {
            get { return stairHeight; }
        }

        // The height per stair
        static float framePerSecond;
        static public float FramePerSecond
        {
            get { return framePerSecond; }
        }

        /************************************************************************/
        /* Method name: Construction Function (Static)                          */
        /************************************************************************/
        static BasicData ()
        {
            windowWidth = 960;
            windowHeight = 540;
            landformWidth = 120;
            landformHeight = 70;
            stairHeight = 21;
            framePerSecond = 30.0f;
        }
    }

    /// <summary>
    /// The constants for walk, containing the size of texture, etc.
    /// </summary>
    public class TextureActionConstants
    {
        // The number of pictures per line
        static private int walkTexturePerLine;
        static public int WalkTexturePerLine
        {
            get { return walkTexturePerLine; }
        }

        // The time for walk
        static private int walkTime;
        static public int WalkTime
        {
            get { return walkTime; }
        }

        // The time for change z-buffer in walk
        static private int walkSwitchTime;
        static public int WalkSwitchTime
        {
            get { return walkSwitchTime; }
        }

        // The size of each picture
        static private VectorTwoDimension walkTexturePictureSize;
        static public VectorTwoDimension WalkTexturePictureSize
        {
            get { return walkTexturePictureSize; }
        }

        // The time interval for walk texture to refresh
        static private int walkTimePerFrame;
        static public int WalkTimePerFrame
        {
            get { return walkTimePerFrame; }
        }

        // The number of pictures per line
        static private int jumpTexturePerLine;
        static public int JumpTexturePerLine
        {
            get { return jumpTexturePerLine; }
        }

        // The time for jump
        static private int jumpTime;
        static public int JumpTime
        {
            get { return jumpTime; }
        }

        // The time for change z-buffer in walk
        static private int jumpSwitchTime;
        static public int JumpSwitchTime
        {
            get { return jumpSwitchTime; }
        }

        // The size of each picture
        static private VectorTwoDimension jumpTexturePictureSize;
        static public VectorTwoDimension JumpTexturePictureSize
        {
            get { return jumpTexturePictureSize; }
        }

        // The time interval for walk texture to refresh
        static private int jumpTimePerFrame;
        static public int JumpTimePerFrame
        {
            get { return jumpTimePerFrame; }
        }
        
        /// <summary>
        /// The static construction function
        /// </summary>
        static TextureActionConstants()
        {
            walkTexturePerLine = 5;
            walkTimePerFrame = 70;
            walkTexturePictureSize = new VectorTwoDimension(128, 256);
            walkTime = 8;
            walkSwitchTime = 3;
            jumpTexturePerLine = 5;
            jumpTimePerFrame = 70;
            jumpTexturePictureSize = new VectorTwoDimension(128, 256);
            // This value must be odd!!
            jumpTime = 9;
            jumpSwitchTime = 3;
        }
    }
}
